<%--
  Created by IntelliJ IDEA.
  User: 栋
  Date: 2022/12/6
  Time: 15:28
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <%@include file="/pages/base/base.jsp"%>
    <script>
        function lahei(user_id){
            var introduce=prompt("请输入原因")
            if(introduce==""){
                alert("原因不能为空")
            }else if(introduce!=null){
                window.location.href="adminServlet?action=addToblackList&user_id="+user_id.innerText+"&introduce="+introduce;
            }
        }
    </script>
</head>
<body>
<div class="container">
    <%@include file="/pages/base/head.jsp"%>
    <%@include file="/pages/base/admin_nav.jsp"%>
    <div>

        <div class="errorMsg">
            ${ empty requestScope.msg ? "":requestScope.msg }
        </div>
        <c:if test="${sessionScope.allUsers!=null}">
            <table id="personalItems_tb">
                <tr>
                    <th>用户编号</th>
                    <th>用户手机号</th>
                    <th>用户名</th>
                    <th>性别</th>
                    <th>个人介绍</th>
                    <th>学号</th>
                    <th>地址</th>
                    <th>管理</th>
                </tr>
                <c:forEach items="${sessionScope.allUsers}" var="users">
                    <tr>
                        <td id="${users.user_id}">${users.user_id}</td>
                        <td>${users.phone_number}</td>
                        <td>${users.user_name}</td>
                        <td>${users.sex}</td>
                        <td>${users.introduce}</td>
                        <td>${users.stu_number}</td>
                        <td>${users.address}</td>
                        <td><a href="javascript:void(0);" onclick="lahei(${users.user_id})">拉黑</a></td>
                    </tr>
                </c:forEach>
            </table>
        </c:if>

    </div>
</div>
</body>
</html>
